<?php

namespace app\controller;

class Index
{
    public function index() {
        return 'hello world';
    }

    public function webhook() {
        $root_path = root_path();
        $sheel = "cd $root_path" . PHP_EOL;
//    $sheel .= 'git stash -u' . PHP_EOL;
        $sheel .= 'git pull --rebase' . PHP_EOL;
//    $sheel .= 'git stash pop' . PHP_EOL;
        $sheel .= 'php think swoole reload';
        return system($sheel);
    }
}
